package com.gotokeep.keep.composition;

import android.os.Handler;
import android.view.Surface;

import com.gotokeep.keep.composition.track.MediaTrackSet;

/**
 * 核心接口类
 * @author xana/cuixianming
 * @version 1.0
 * @since 2018-04-26 10:32
 */
interface MediaComposition {

    /**
     * 合成器状态改变的监听器
     */
    interface EventListener {
        void onSetup();
        void onReleased();

        void onPreparing();
        void onRenderedFrame(int frame, long timeUs);

        void onError(Exception e);
    }

    interface ExportListener {
        void onExportStart(int totalFrame);
        void onExportFrame(int frame, long timeUs);
        void onExportMuxing();
        void onExportComplete();
        void onExportError(Exception e);
    }

    void setup(Surface outputSurface);
    void release();

    void setVideoTrackSet(MediaTrackSet trackSet);
    void prepare();

    void setOutputSurface(Surface outputSurface);
    void start();
    void pause();
    void seekTo(long timeUs);

    void export(MediaExportConfiguration configuration);
    void setExportListener(Handler exportEventHandler);
}
